package com.hui10.mediaplayer.sigleton

/**
 * Author: Created by lucus on 2019/5/24.
 * E-mail: mcphilex1989@gmail.com
 * Tel: 15652608401
 */
class LazySingletoDemo private constructor() {

    companion object {
        private var instance: LazySingletoDemo? = null
            get() {
                if (field == null) {
                    field = LazySingletoDemo()
                }
                return field
            }

        fun get():LazySingletoDemo{
            return instance!!
        }
    }

    fun printName(){
        println(javaClass.simpleName)
    }
}